from TextBadger.models import *
from xml.dom.minidom import parse
from django.conf import settings
import sys

def Vectorize(vector):
        return True

vectors = Corpus_Vector.objects.filter(status=2)

for vector in vectors:
	vector.status=3
	vector.save()

for vector in vectors:
	print vector.id
	
	try:
		# check code file for security issues
		r = Vectorize(vector)
		if r == True:
			vector.status = 1
			vector.save()
		else:
                        vector.status = 4
                        vector.save()
	except:
		print sys.exc_type, ":", sys.exc_value
		print 'Error Encountered'
		vector.status = 4
		vector.save()

